Test Series - Data Structure

Test Number 84/115

Q: d-heap is similar to that of a?
A. binary heap
B. fibonacci heap
C. leftist heap
D. treap
Solution: A d-heap is similar to that of a binary heap except that binary heaps have two children and d-heaps have d children.
Q: d-heap is shallower than a binary heap.
A. true
B. false
C. 
D. 
Solution: d-heap is much shallower than a binary heap with respect to performance efficiency of insert and delete operations.
Q: Which operation cannot be directly performed in a d-heap?
A. insert
B. delete
C. find
D. create
Solution: Find operation in a d-heap cannot be performed as in other heaps. This is the main weakness of d-heap.
Q: Which operation is not efficiently performed in a d-heap?
A. insert
B. delete
C. find
D. merge
Solution: Unlike find operation, which cannot be performed in a d-heap, the task of merging two d-heaps is very difficult.
Q: What is the run time efficiency of an insertion algorithm in d-heap?
A. O(N)
B. O(log N)
C. O(logd N)
D. O(Nd)
Solution: The run time efficiency of an insertion algorithm in a d-heap is found to be O(logd N) where d is the number of children.
Q: How many comparisons will occur while performing a delete-min operation?
A. d
B. d-1
C. d+1
D. 1
Solution: Since, the delete-min operation is more expensive and the heap is shallow, the minimum of d elements can be found using d-1 comparisons.
Q: How many basic operations can be performed in a d-heap?
A. 1
B. 2
C. 3
D. 4
Solution: The two basic operations performed in a d-heap are insert and delete-min operations.
Q: What is the run time efficiency of delete-min operation?
A. O(log N)
B. O(logd N)
C. O(d logd N)
D. O(d)
Solution: The run time efficiency of a delete-min algorithm using d-1 comparisons is mathematically found to be O(d logd N).
Q: How many secondary operations are performed in a d-heap?
A. 1
B. 2
C. 3
D. 4
Solution: The other operations that can be performed in a d-heap are increasekey, decreasekey, buildheap and delete.
Q: On which data structure is a d-ary heap based?
A. stack
B. queue
C. linked list
D. priority queue
Solution: d-ary heap is a priority queue based data structure that is a generalization of binary heaps.

You Have Score    /10